package yxy.cherry.router.server;

import yxy.banana.server.management.Clustered;

public class RouterServerCluster extends Clustered<String, RouterServerHandler> {
	public RouterServerHandler balance(int cluster) {
		String key = key(cluster);
		return this.balance(key);
	}

	public synchronized String add(int cluster, RouterServerHandler handler) {
		String key = key(cluster);
		this.add(key, handler);
		return key;
	}

	private static String key(int cluster) {
		return String.format("c_%d", cluster);
	}
}
